package com.lzm.bean;

public class LazyBoardUser implements Comparable<LazyBoardUser>{
    private String userPhone;
    private String userName;
    private int expressNumber;

    @Override
    public String toString() {
        return "LazyBoardUser{" +
                "userPhone='" + userPhone + '\'' +
                ", userName='" + userName + '\'' +
                ", expressNumber=" + expressNumber +
                '}';
    }

    public String getUserPhone() {
        return userPhone;
    }

    public void setUserPhone(String userPhone) {
        this.userPhone = userPhone;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public int getExpressNumber() {
        return expressNumber;
    }

    public void setExpressNumber(int expressNumber) {
        this.expressNumber = expressNumber;
    }

    public LazyBoardUser(String userPhone, String userName, int expressNumber) {
        this.userPhone = userPhone;
        this.userName = userName;
        this.expressNumber = expressNumber;
    }

    public LazyBoardUser() {
    }

    @Override
    public int compareTo(LazyBoardUser lazyBoardUser) {
        // 先按照快递数量排序
        int i = lazyBoardUser.getExpressNumber() - this.getExpressNumber() ;
        //如果快递数相等则按名字排
        if (i == 0){
            return this.getUserName().compareTo(lazyBoardUser.getUserName());
        }
        return i;
    }
}
